package com.cq.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cq.ssm.mapper.ContracttypeMapper;
import com.cq.ssm.po.Contracttype;
import com.cq.ssm.service.ContracttypeService;

@Component("contracttypeService")
public class ContracttypeServiceImpl implements ContracttypeService{

	@Autowired
	private ContracttypeMapper ctm;
	/**
	 * 插入一条记录   成功返回true  失败返回false
	 */
	public boolean insertContracttype(Contracttype c) throws Exception{
		int i = ctm.insertSelective(c);
		return i==1?true:false;
	}

	/**
	 * 查询所有记录
	 */
	public List<Contracttype> findAll() throws Exception{
		return ctm.findAll();
	}

	/**
	 * 根据id删除一条记录
	 */
	public boolean deleteById(Integer id) throws Exception{
		int i = ctm.deleteByPrimaryKey(id);
		return i==1?true:false;
	}

}
